package com.study.zzedu.fragment.home.onlinevideo;

import android.content.Context;

import com.study.zzedu.base.BasePresenter;
import com.study.zzedu.http.OnResultListener;

/**
 * Created by kiros on 2020/9/3.
 */

public class OnlineVideoPresenter extends BasePresenter<OnlineVideoContract.IView> {

    private OnlineVideoModel nModel;
    public OnlineVideoPresenter(){
        this.nModel = new OnlineVideoModel();
    }
    public void getDataList(Context context){
        nModel.getDataList(context,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getLessonList(result);
            }

            @Override
            public void onError(String error) {
                getView().showError(error);
            }
        });
    }

    public void getLivePlayUrl(Context context,String url){
        nModel.getLivePlayUrl(context,url,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getLessonProgress(result);
            }

            @Override
            public void onError(String error) {
                getView().showError(error);
            }
        });
    }
}
